package com.ruoyi.system.service.impl.fxImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.fx.FxAppointmentItem;
import com.ruoyi.system.mapper.fx.FxAppointmentItemMapper;
import com.ruoyi.system.service.fx.IFxAppointmentItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务预约项Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-29
 */
@Service
public class FxAppointmentItemServiceImpl extends ServiceImpl<FxAppointmentItemMapper,FxAppointmentItem> implements IFxAppointmentItemService
{
    @Autowired
    private FxAppointmentItemMapper fxAppointmentItemMapper;

    /**
     * 查询服务预约项
     *
     * @param id 服务预约项主键
     * @return 服务预约项
     */
    @Override
    public FxAppointmentItem selectFxAppointmentItemById(Long id)
    {
        return fxAppointmentItemMapper.selectFxAppointmentItemById(id);
    }

    /**
     * 查询服务预约项列表
     *
     * @param fxAppointmentItem 服务预约项
     * @return 服务预约项
     */
    @Override
    public List<FxAppointmentItem> selectFxAppointmentItemList(FxAppointmentItem fxAppointmentItem)
    {
        return fxAppointmentItemMapper.selectFxAppointmentItemList(fxAppointmentItem);
    }

    /**
     * 新增服务预约项
     *
     * @param fxAppointmentItem 服务预约项
     * @return 结果
     */
    @Override
    public int insertFxAppointmentItem(FxAppointmentItem fxAppointmentItem)
    {
        fxAppointmentItem.setCreateTime(DateUtils.getNowDate());
        return fxAppointmentItemMapper.insertFxAppointmentItem(fxAppointmentItem);
    }

    /**
     * 修改服务预约项
     *
     * @param fxAppointmentItem 服务预约项
     * @return 结果
     */
    @Override
    public int updateFxAppointmentItem(FxAppointmentItem fxAppointmentItem)
    {
        fxAppointmentItem.setUpdateTime(DateUtils.getNowDate());
        return fxAppointmentItemMapper.updateFxAppointmentItem(fxAppointmentItem);
    }

    /**
     * 批量删除服务预约项
     *
     * @param ids 需要删除的服务预约项主键
     * @return 结果
     */
    @Override
    public int deleteFxAppointmentItemByIds(Long[] ids)
    {
        return fxAppointmentItemMapper.deleteFxAppointmentItemByIds(ids);
    }

    /**
     * 删除服务预约项信息
     *
     * @param id 服务预约项主键
     * @return 结果
     */
    @Override
    public int deleteFxAppointmentItemById(Long id)
    {
        return fxAppointmentItemMapper.deleteFxAppointmentItemById(id);
    }
}
